package com.spirit.mypopup;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;

import com.spirit.mypopup.pop.MyPop;

import java.util.Calendar;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);


        findViewById(R.id.btn2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //new MyPop().showPopWindow(Main2Activity.this, view);


                ss();
            }
        });


    }

    private void ss() {

        Calendar ca = Calendar.getInstance();
        int mYear = ca.get(Calendar.YEAR);
        int mMonth = ca.get(Calendar.MONTH);
        int mDay = ca.get(Calendar.DAY_OF_MONTH);

        DatePickerDialog datePickerDialog = new DatePickerDialog(this,
                AlertDialog.THEME_HOLO_LIGHT,
                new DatePickerDialog.OnDateSetListener() {
                    @Override
                    public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
                        /*mYear = year;
                        mMonth = month;
                        mDay = dayOfMonth;
                        final String data =  (month+1) + "月-" + dayOfMonth + "日 ";*/
                    }
                }, mYear, mMonth, mDay);
        datePickerDialog.setTitle("选择日期");
        //datePickerDialog.setMessage("eeee");
        datePickerDialog.show();
    }
}
